//api文件仍保留但不建议使用，推荐使用models中的api。API files remain preserved (deprecated), use models APIs instead.
import type { ModuleConfig, ModuleConfigResponse } from './types.js';

import { requestClient } from '#/api/request';

export const getuctooModuleConfigList = async (page: number, pageSize: number,
  searchParams?: any) => {
  return requestClient.get<ModuleConfigResponse>(`/uctoo/module_config/${pageSize}/${page}`,{
    params: searchParams,
  });
};

export const getuctooModuleConfig = async (id: string) => {
  return requestClient.get<ModuleConfig>(`/uctoo/module_config/${id}`);
};

export const adductooModuleConfig = async (data: Partial<ModuleConfig>) => {
  return requestClient.post<ModuleConfig>('/uctoo/module_config/add', data);
};

export const edituctooModuleConfig = async (data: Partial<ModuleConfig>) => {
  return requestClient.post<ModuleConfig>('/uctoo/module_config/edit', data);
};

export const deleteuctooModuleConfig = async (id: string) => {
  return requestClient.post<any>('/uctoo/module_config/del', { id });
};
